package com.guigu.limeng.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.guigu.limeng.mapper.MdesignprocedureMapper;
import com.guigu.limeng.pojo.Mdesignprocedure;
import com.guigu.limeng.service.MdesignprocedureService;
import com.guigu.liuzhireng.pojo.PageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MdesignprocedureServiceImpl implements MdesignprocedureService {

    @Autowired
    MdesignprocedureMapper mdesignprocedureMapper;


    @Override
    public Mdesignprocedure MdesignprocedureWZY_cha(String id) {
        return mdesignprocedureMapper.MdesignprocedureWZY_cha(id);
    }

    @Override
    public Mdesignprocedure MdesignprocedureWZY_SH_cha(Integer id) {
        return mdesignprocedureMapper.selectByPrimaryKey(id);
    }

    @Override
    public Mdesignprocedure AddMdesignprocedure(Mdesignprocedure mdesignprocedure) {
        mdesignprocedureMapper.AddMdesignprocedure(mdesignprocedure);
        return mdesignprocedure;
    }

    @Override
    public PageVo<Mdesignprocedure> showMdeure(int num, int size) {
        PageHelper.startPage(num,size);
        List<Mdesignprocedure> list = mdesignprocedureMapper.showMdeure();
        PageInfo pageInfo=new PageInfo(list);
        PageVo<Mdesignprocedure> pageVo=new PageVo();
        pageVo.setTotal(pageInfo.getTotal());
        pageVo.setRows(pageInfo.getList());
        return pageVo;

    }
    @Override
    public int upBySHBZ(Mdesignprocedure mdesignprocedure) {
        return mdesignprocedureMapper.upBySHBZ(mdesignprocedure);
    }

    @Override
    public PageVo<Mdesignprocedure> PageChaXun(int num, int size) {
        PageHelper.startPage(num,size);
        List<Mdesignprocedure> list = mdesignprocedureMapper.ChaXun();
        PageInfo pageInfo=new PageInfo(list);
        PageVo<Mdesignprocedure> pageVo=new PageVo();
        pageVo.setTotal(pageInfo.getTotal());
        pageVo.setRows(pageInfo.getList());
        return pageVo;
    }

    @Override
    public PageVo<Mdesignprocedure> PageBianGeng(int num, int size) {
        PageHelper.startPage(num,size);
        List<Mdesignprocedure> list = mdesignprocedureMapper.PageBianGeng();
        PageInfo pageInfo=new PageInfo(list);
        PageVo<Mdesignprocedure> pageVo=new PageVo();
        pageVo.setTotal(pageInfo.getTotal());
        pageVo.setRows(pageInfo.getList());
        return pageVo;
    }

    @Override
    public PageVo<Mdesignprocedure> findWuLiao(int num,int size) {
        PageHelper.startPage(num,size);
        List<Mdesignprocedure> wuLiao = mdesignprocedureMapper.findWuLiao();
        PageInfo pageInfo=new PageInfo(wuLiao);
        PageVo<Mdesignprocedure> pageVo=new PageVo();
        pageVo.setTotal(pageInfo.getTotal());
        pageVo.setRows(pageInfo.getList());
        return pageVo;
    }

    @Override
    public int updaByWuLiao(String productid) {
        return mdesignprocedureMapper.updaByWuLiao(productid);
    }

    @Override
    public int limengUpdate(Mdesignprocedure mdesignprocedure) {
        return mdesignprocedureMapper.updateByPrimaryKeySelective(mdesignprocedure);
    }

    @Override
    public PageVo<Mdesignprocedure> LiMengMdesignprocedureSH(int num, int size) {
        PageHelper.startPage(num,size);
        List<Mdesignprocedure> wuLiao = mdesignprocedureMapper.LiMengMdesignprocedureSH();
        PageInfo pageInfo=new PageInfo(wuLiao);
        PageVo<Mdesignprocedure> pageVo=new PageVo();
        pageVo.setTotal(pageInfo.getTotal());
        pageVo.setRows(pageInfo.getList());
        return pageVo;
    }

    @Override
    public int limeng_UpDate_Mdesignprocedure(Mdesignprocedure mdesignprocedure) {
        return mdesignprocedureMapper.updateByPrimaryKeySelective(mdesignprocedure);
    }

    @Override
    public PageVo<Mdesignprocedure> LiMengUpDateMdesignprocedureCha(int num, int size) {
        PageHelper.startPage(num,size);
        List<Mdesignprocedure> wuLiao = mdesignprocedureMapper.LiMengUpDateMdesignprocedureCha();
        PageInfo pageInfo=new PageInfo(wuLiao);
        PageVo<Mdesignprocedure> pageVo=new PageVo();
        pageVo.setTotal(pageInfo.getTotal());
        pageVo.setRows(pageInfo.getList());
        return pageVo;
    }

}
